<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./登录.css">
</head>
<body>
    <!-- 登录 -->
    <div class="warp">
        <div class="zuo">
            <h1>淘宝</h1>
        </div>
        <div class="you">
            <div class="kuang">
                <div class="zhang"> <span class="s">账号:</span> <input type="text" class="hu" placeholder="请输入账号"></div>
                <div class="mi"><span class="s1">密码:</span><input type="text" class="hu1" placeholder="请输入密码"></div>
                <div class="ji"><input type="checkbox" name="记住密码" id="ji"><span>记住密码</span></div>
                <button id="den" onclick="denglu()">登录</button>
            </div>
        </div>
    </div>
    <script>
        function denglu() {
            var hu = document.querySelector('.hu').value
            var hu1 = document.querySelector('.hu1').value
        
            var name = localStorage.getItem('name')
            var pass = localStorage.getItem('pass')
            if (name != hu || pass != hu1) {
                alert('您输入的用户名或密码有误')
            } else {
                location.assign('./首页.html')
            }

        }
    </script>
</body>

</html>